package cn.aofeng.example;
import java.util.concurrent.Callable;
/**
 * 需要返回值的异步任务。
 * @author <a href="mailto:aofengblog@163.com">聂勇</a>
 */
public class CallableAnsyTask implements Callable<Long> {
	private int[] arr;
	public CallableAnsyTask(int[] arr) {
		this.arr = arr;
	}
	@Override
	public Long call() throws Exception {
		long result = 0;
		for (int value : arr) {
			result += value;
		}
		return result;
	}
}
